<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 三栏布局，左右两列定宽，中间列自适应 圣杯布局 */

        .container{
            height: 300px;
            margin-left: 200px;
            margin-right: 200px;
        }

        .main{
            float: left;
            width: 100%;
            background-color: red;

        }

        .left{
            float: left;
            width: 200px;
            margin-left: -100%;
            background-color: rebeccapurple;

            position: relative;
            left: -200px;
        }
        
        .right{
            float: left;
            width: 200px;
            margin-left: -200px;
            background-color: blue;

            position: relative;
            right: -200px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="main">
            gggggggggggggggggggggggggggggggggggggggggggggd
            fsdfsgfgfdgfdgfg
        </div>
        <div class="left">left</div>         
        <div class="right">right</div>
       
    </div>
   
</body>
</html>